package com.cavy.platform.server.validator;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * 验证git url
 */
public class GitUrlValidator implements ConstraintValidator<GitUrl, String> {


    @Override
    public void initialize(GitUrl constraintAnnotation) {

    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        if (value.endsWith(".git")) {
            return true;
        }
        return false;
    }
}
